Repository navigation
fix: Treat a null optional property in flag data as omitted - #268
Open
kinyoklion wants to merge 1 commit into
Open
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
An explicit null for an optional string or boolean property of a clause, rollout or segment rule made the parser throw, so the whole flag data set was rejected. These properties are now read as when they are omitted. Generated-by: termag
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: Narrow parser fix in DataModelSerialization.java treating explicit nulls on optional clause, rollout, and segment-rule properties as omitted, with a dedicated unit test covering that contract. Bugbot completed with no findings.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


An explicit
nullfor an optional string or boolean property of a clause (contextKind,negate), a rollout (contextKind,bucketBy,kind) or a segment rule (rolloutContextKind,bucketBy) made the parser throw. The SDK then rejected the whole flag data set and never initialized. These properties are now read the same way as when they are omitted, which the flag data model requires. The other optional properties already acceptednull.Testing: a new unit test fails without the fix and passes with it; the explicit-null contract tests go from FAIL to PASS, and the full v2 and v3 contract suites have no result changes.
SDK-3662
Opened from termag
Note
Overview
Fixes flag/segment JSON deserialization when optional fields are explicitly
null. Several custom Gson type adapters inDataModelSerializationusednextString()/nextBoolean()on properties that the data model treats as optional, which caused the parser to throw and could prevent the SDK from loading the full dataset.Clause, Rollout, and SegmentRule adapters now read
contextKind,bucketBy,kind, andnegatethrough new helpers (readNullableString,readNullableContextKind,readBooleanOrFalse) so explicit JSONnullmatches an omitted field—e.g. nullnegate→false, nullcontextKind→ literal attribute paths. A unit test asserts this contract for nested flag and segment payloads.Reviewed by Cursor Bugbot for commit 7b9e54a. Bugbot is set up for automated code reviews on this repo. Configure here.